import originAxios from 'axios'

export function axios(config) {
  /*设置基本请求信息*/
  const instance = originAxios.create({
    baseURL: "http://123.207.32.32:8000/api/hy",
    /*    baseURL: "http://106.54.54.237:8000/api/hy",*/
    /*baseURL : "新接口请找老师拿,*/
    timeout: 5000
  })

  /*浏览器请求拦截*/
  instance.interceptors.request.use(config => {
    return config;
  }, error => {
    return error;
  })

  /*服务器响应拦截*/
  instance.interceptors.response.use(res => {
    return res.data;
  }, error => {
    return error;
  })

  return instance(config)
}
